#coding:utf-8
from pyquery import PyQuery as pq
fo = open(r"D:\foo.txt", "wb")
d=pq(filename=r"C:\Users\Administrator\Desktop\test1.html",encoding="gbk")
print d
table=d('table')
for i in range(2,10):
 tr=table('tr').eq(i)
 line=tr('td').eq(0).text()+tr('td').eq(1).text()+tr('td').eq(5).text()+tr('td').eq(10).text()+"\n"
 line=line.encode('utf-8')
 print line
 #fo.write(line)
fo.close()